from time import sleep


class Clock():
    def __init__(self, hour=0, minute=0, second=0):
        """
        注释方法
        :param hour: 时
        :param minute: 分
        :param second: 秒
        """
        self._hour = hour
        self._minute = minute
        self._second = second

    def run(self):
        """时间走动"""
        self._second += 1
        if self._second == 60:
            self._second = 0
            self._minute += 1
            if self._minute == 60:
                self._minute = 0
                self._hour += 1
                if self._hour == 24:
                    self._hour = 0

    def show(self):
        """显示时间"""
        return '%02d:%02d:%02d' % \
            (self._hour, self._minute, self._second)


def main():
    clock = Clock(23, 59, 58)
    while True:
        print(clock.show())
        sleep(1)
        clock.run()


if __name__ == '__main__':
    main()


class Grandfather(object):
    def __init__(self):
        self.looks = '爷爷的:黑头发'


class Father(Grandfather):
    def complexion(self):
        return '爸爸的:黄皮肤'


class Son(Father):
    def heith(self):
        return '178cm'


G = Grandfather()
print(G.looks)

F = Father()
print(F.complexion())

S = Son()
print(S.heith())
print(s.complexion())

# 全局 78
# 4 34
# 12 90
# 17 78